package com.github.ltsopensource.example.springboot;

import com.github.ltsopensource.example.springboot.utils.YmlHelper;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.HashMap;
import java.util.Map;

/**
 * @author kennylee
 */
@Configuration
@ConfigurationProperties(prefix = "lts.tasktracker.jobrunner")
public class JobRunnerConfig {
    private final Map<String, String> mapper = new HashMap<String, String>();

    public Map<String, String> getMapper() {
        return this.mapper;
    }

    /**
     * <p>由于yml文件构造的Map里面的key带有索引号，故此编写此方便遍历。</p>
     *
     * @return Map
     */
    public Map<String, String> getCMapper() {
        return YmlHelper.getCMapper(this.mapper);
    }
}
